﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="Works.aspx.cs" Inherits="PmSadis.WebFormsUi.Operator.Works" %>

<%@ Register Assembly="DevExpress.Web.v11.2, Version=11.2.10.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxTabControl" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v11.2, Version=11.2.10.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v11.2, Version=11.2.10.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridLookup" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v11.2, Version=11.2.10.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v11.2, Version=11.2.10.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxClasses" TagPrefix="dx" %>
<asp:Content ID="worksHead" ContentPlaceHolderID="head" runat="server">
    <link href="../Content/oper.works.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="worksContent" ContentPlaceHolderID="content" runat="server">
    <h2>Справочник работ</h2>
    <asp:ScriptManager ID="worksScriptManager" runat="server" />
    <!--works data source-->
    <asp:ObjectDataSource ID="dsWorks" runat="server" TypeName="PmSadis.WebFormsUi.Operator.Works"
        SelectMethod="AllWorks" InsertMethod="InsertWork" OnInserted="dsWorks_Inserted"
        DeleteMethod="DeleteWork" UpdateMethod="UpdateWork" />
    <!--units data source-->
    <asp:ObjectDataSource ID="dsUnits" runat="server" TypeName="PmSadis.WebFormsUi.Operator.Works"
        SelectMethod="Units" />
    <!--materials data source-->
    <asp:ObjectDataSource ID="dsMaterials" runat="server" TypeName="PmSadis.WebFormsUi.Operator.Works"
        SelectMethod="Materials" />
    <!--work materials data source-->
    <asp:ObjectDataSource ID="dsWorkMaterials" runat="server" TypeName="PmSadis.WebFormsUi.Operator.Works"
        SelectMethod="WorkMaterials" InsertMethod="InsertWorkMaterial" UpdateMethod="UpdateWorkMaterial"
        DeleteMethod="DeleteWorkMaterial">
        <SelectParameters>
            <asp:SessionParameter Name="workId" DbType="Int32" SessionField="oper-edit-work-id" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <!--mechanisms data source-->
    <asp:ObjectDataSource ID="dsMechanisms" runat="server" TypeName="PmSadis.WebFormsUi.Operator.Works"
        SelectMethod="Mechanisms" />
    <!--work mechanisms data source-->
    <asp:ObjectDataSource ID="dsWorkMechanisms" runat="server" TypeName="PmSadis.WebFormsUi.Operator.Works"
        SelectMethod="WorkMechanisms" InsertMethod="InsertWorkMechanism" UpdateMethod="UpdateWorkMechanism"
        DeleteMethod="DeleteWorkMechanism">
        <SelectParameters>
            <asp:SessionParameter Name="workId" DbType="Int32" SessionField="oper-edit-work-id" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <!--drivers data source-->
    <asp:ObjectDataSource ID="dsDrivers" runat="server" TypeName="PmSadis.WebFormsUi.Operator.Works"
        SelectMethod="Drivers" />
    <!--work drivers data source-->
    <asp:ObjectDataSource ID="dsWorkDrivers" runat="server" TypeName="PmSadis.WebFormsUi.Operator.Works"
        SelectMethod="WorkDrivers" InsertMethod="InsertWorkDriver" UpdateMethod="UpdateWorkDriver"
        DeleteMethod="DeleteWorkDriver">
        <SelectParameters>
            <asp:SessionParameter Name="workId" DbType="Int32" SessionField="oper-edit-work-id" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <!--workers data source-->
    <asp:ObjectDataSource ID="dsWorkers" runat="server" TypeName="PmSadis.WebFormsUi.Operator.Works"
        SelectMethod="Workers" />
    <!--workers drivers data source-->
    <asp:ObjectDataSource ID="dsWorkWorkers" runat="server" TypeName="PmSadis.WebFormsUi.Operator.Works"
        SelectMethod="WorkWorkers" InsertMethod="InsertWorkWorker" UpdateMethod="UpdateWorkWorker"
        DeleteMethod="DeleteWorkWorker">
        <SelectParameters>
            <asp:SessionParameter Name="workId" DbType="Int32" SessionField="oper-edit-work-id" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:UpdatePanel ID="worksUpdatePanel" runat="server">
        <ContentTemplate>
            <dx:ASPxGridView ID="gvWorks" runat="server" DataSourceID="dsWorks" KeyFieldName="WorkId"
                OnInit="gvWorks_Init" OnRowInserting="gvWorks_RowInserting" OnRowInserted="gvWorks_RowInserted"
                OnStartRowEditing="gvWorks_StartRowEditing" OnRowUpdating="gvWorks_RowUpdating">
                <Columns>
                    <dx:GridViewDataDateColumn FieldName="DateCreate" Visible="false" />
                    <dx:GridViewCommandColumn>
                        <NewButton Visible="true" />
                        <EditButton Visible="true" />
                        <DeleteButton Visible="true" />
                    </dx:GridViewCommandColumn>
                    <dx:GridViewDataTextColumn FieldName="Name" Caption="Наименование работы" />
                    <dx:GridViewDataTextColumn FieldName="Code" Caption="Шифр" />
                    <dx:GridViewDataComboBoxColumn FieldName="UnitId" Caption="Единица измерения">
                        <EditItemTemplate>
                            <dx:ASPxGridLookup ID="lucUnits" runat="server" DataSourceID="dsUnits" KeyFieldName="UnitId"
                                Width="100%" OnInit="lucUnits_Init" SelectionMode="Single">
                                <GridViewProperties>
                                    <Settings ShowFilterRow="true" ShowFilterRowMenu="true" />
                                </GridViewProperties>
                                <Columns>
                                    <dx:GridViewCommandColumn Caption="Выбрать" ShowSelectCheckbox="true" Width="50" />
                                    <dx:GridViewDataTextColumn FieldName="Name" Caption="Наименование" />
                                </Columns>
                            </dx:ASPxGridLookup>
                        </EditItemTemplate>
                        <PropertiesComboBox DataSourceID="dsUnits" ValueField="UnitId" ValueType="System.Int32"
                            TextField="Name" />
                    </dx:GridViewDataComboBoxColumn>
                    <dx:GridViewDataCheckColumn FieldName="UseDetail" Caption="Адресная привязка" />
                    <dx:GridViewDataSpinEditColumn Caption="Базвая стоимость" FieldName="CostBase">
                        <PropertiesSpinEdit DecimalPlaces="2" DisplayFormatString="{0:c}" />
                        <EditFormSettings Visible="False" />
                    </dx:GridViewDataSpinEditColumn>
                </Columns>
                <Templates>
                    <EditForm>
                        <dx:ASPxPageControl runat="server" ID="editor" Width="100%" OnInit="editor_Init">
                            <TabPages>
                                <dx:TabPage Text="Основные данные">
                                    <ContentCollection>
                                        <dx:ContentControl runat="server">
                                            <dx:ASPxGridViewTemplateReplacement ID="Editors" ReplacementType="EditFormEditors"
                                                runat="server" />
                                        </dx:ContentControl>
                                    </ContentCollection>
                                </dx:TabPage>
                                <dx:TabPage Text="Строительные материалы" Name="tpMaterials">
                                    <ContentCollection>
                                        <dx:ContentControl>
                                            <dx:ASPxHyperLink ID="hlMaterials" runat="server" NavigateUrl="Materials.aspx" Text="Материалы" />
                                            <dx:ASPxGridView ID="gvWorkMaterials" runat="server" DataSourceID="dsWorkMaterials"
                                                KeyFieldName="WorkMaterialId" OnInit="gvWorkMaterials_Init" OnRowInserting="gvWorkMaterials_RowInserting"
                                                OnRowUpdating="gvWorkMaterials_RowUpdating">
                                                <Settings ShowFooter="true" />
                                                <TotalSummary>
                                                    <dx:ASPxSummaryItem FieldName="UnitId" SummaryType="Count" />
                                                    <dx:ASPxSummaryItem FieldName="Cost" SummaryType="Sum" />
                                                </TotalSummary>
                                                <Columns>
                                                    <dx:GridViewDataDateColumn FieldName="DateCreate" Visible="false" />
                                                    <dx:GridViewCommandColumn>
                                                        <NewButton Visible="true" />
                                                        <EditButton Visible="true" />
                                                        <DeleteButton Visible="true" />
                                                    </dx:GridViewCommandColumn>
                                                    <dx:GridViewDataTextColumn FieldName="Name" Caption="Наименование материала">
                                                        <EditFormSettings Visible="False" />
                                                    </dx:GridViewDataTextColumn>
                                                    <dx:GridViewDataSpinEditColumn FieldName="Value" Caption="Объем, ед. изм.">
                                                        <PropertiesSpinEdit MinValue="0" NumberType="Float" />
                                                    </dx:GridViewDataSpinEditColumn>
                                                    <dx:GridViewDataComboBoxColumn FieldName="UnitId" Caption="Единица измерения">
                                                        <EditFormSettings Visible="False" />
                                                        <PropertiesComboBox DataSourceID="dsUnits" ValueField="UnitId" ValueType="System.Int32"
                                                            TextField="Name" />
                                                    </dx:GridViewDataComboBoxColumn>
                                                    <dx:GridViewDataSpinEditColumn FieldName="CostBase" Caption="Стоимость ед. изм.">
                                                        <PropertiesSpinEdit DecimalPlaces="2" DisplayFormatString="{0:c}" />
                                                        <EditFormSettings Visible="False" />
                                                    </dx:GridViewDataSpinEditColumn>
                                                    <dx:GridViewDataSpinEditColumn FieldName="Cost" Caption="Общая стоимость">
                                                        <PropertiesSpinEdit DecimalPlaces="2" DisplayFormatString="{0:c}" />
                                                        <EditFormSettings Visible="False" />
                                                    </dx:GridViewDataSpinEditColumn>
                                                    <dx:GridViewDataComboBoxColumn FieldName="MaterialId" Caption="Материал" Visible="false">
                                                        <EditFormSettings Visible="True" />
                                                        <EditItemTemplate>
                                                            <dx:ASPxGridLookup ID="lucMaterials" runat="server" DataSourceID="dsMaterials" KeyFieldName="MaterialId"
                                                                SelectionMode="Single" Width="100%" DisplayFormatString="{0}" OnInit="lucMaterials_Init">
                                                                <GridViewProperties>
                                                                    <Settings ShowFilterRow="true" ShowFilterRowMenu="true" />
                                                                </GridViewProperties>
                                                                <Columns>
                                                                    <dx:GridViewCommandColumn ShowSelectCheckbox="true" Caption="Выбрать" Width="50">
                                                                        <ClearFilterButton Visible="true" />
                                                                    </dx:GridViewCommandColumn>
                                                                    <dx:GridViewDataTextColumn FieldName="Name" Caption="Наименование материала" />
                                                                    <dx:GridViewDataTextColumn FieldName="Code" Caption="Шифр" />
                                                                    <dx:GridViewDataSpinEditColumn FieldName="CostBase" Caption="Базовая стоимость">
                                                                        <PropertiesSpinEdit DecimalPlaces="2" DisplayFormatString="{0:c}" />
                                                                    </dx:GridViewDataSpinEditColumn>
                                                                    <dx:GridViewDataComboBoxColumn FieldName="Unit.Name" Caption="Единица измерения">
                                                                        <PropertiesComboBox DataSourceID="dsUnits" ValueField="UnitId" ValueType="System.Int32"
                                                                            TextField="Name" />
                                                                    </dx:GridViewDataComboBoxColumn>
                                                                </Columns>
                                                            </dx:ASPxGridLookup>
                                                        </EditItemTemplate>
                                                    </dx:GridViewDataComboBoxColumn>
                                                </Columns>
                                            </dx:ASPxGridView>
                                        </dx:ContentControl>
                                    </ContentCollection>
                                </dx:TabPage>
                                <dx:TabPage Text="Эксплуатация машин" Name="tpMechanisms">
                                    <ContentCollection>
                                        <dx:ContentControl>
                                            <dx:ASPxHyperLink ID="hlMechanisms" runat="server" NavigateUrl="Mechanisms.aspx" Text="Механизмы" />
                                            <dx:ASPxGridView ID="gvWorkMechanisms" runat="server" DataSourceID="dsWorkMechanisms"
                                                KeyFieldName="WorkMechanismId" OnInit="gvWorkMechanisms_Init" OnRowInserting="gvWorkMechanisms_RowInserting"
                                                OnRowUpdating="gvWorkMechanisms_RowUpdating">
                                                <Settings ShowFooter="true" />
                                                <TotalSummary>
                                                    <dx:ASPxSummaryItem FieldName="UnitId" SummaryType="Count" />
                                                    <dx:ASPxSummaryItem FieldName="Cost" SummaryType="Sum" />
                                                </TotalSummary>
                                                <Columns>
                                                    <dx:GridViewDataDateColumn FieldName="DateCreate" Visible="false" />
                                                    <dx:GridViewCommandColumn>
                                                        <NewButton Visible="true" />
                                                        <EditButton Visible="true" />
                                                        <DeleteButton Visible="true" />
                                                    </dx:GridViewCommandColumn>
                                                    <dx:GridViewDataTextColumn FieldName="Name" Caption="Наименование механизма">
                                                        <EditFormSettings Visible="False" />
                                                    </dx:GridViewDataTextColumn>
                                                    <dx:GridViewDataSpinEditColumn FieldName="Value" Caption="Объем, ед. изм.">
                                                        <PropertiesSpinEdit MinValue="0" NumberType="Float" />
                                                    </dx:GridViewDataSpinEditColumn>
                                                    <dx:GridViewDataComboBoxColumn FieldName="UnitId" Caption="Единица измерения">
                                                        <EditFormSettings Visible="False" />
                                                        <PropertiesComboBox DataSourceID="dsUnits" ValueField="UnitId" ValueType="System.Int32"
                                                            TextField="Name" />
                                                    </dx:GridViewDataComboBoxColumn>
                                                    <dx:GridViewDataSpinEditColumn FieldName="CostBase" Caption="Стоимость ед. изм.">
                                                        <PropertiesSpinEdit DecimalPlaces="2" DisplayFormatString="{0:c}" />
                                                        <EditFormSettings Visible="False" />
                                                    </dx:GridViewDataSpinEditColumn>
                                                    <dx:GridViewDataSpinEditColumn FieldName="Cost" Caption="Общая стоимость">
                                                        <PropertiesSpinEdit DecimalPlaces="2" DisplayFormatString="{0:c}" />
                                                        <EditFormSettings Visible="False" />
                                                    </dx:GridViewDataSpinEditColumn>
                                                    <dx:GridViewDataComboBoxColumn FieldName="MechanismId" Caption="Механизм" Visible="false">
                                                        <EditFormSettings Visible="True" />
                                                        <EditItemTemplate>
                                                            <dx:ASPxGridLookup ID="lucMechanisms" runat="server" DataSourceID="dsMechanisms" KeyFieldName="MechanismId"
                                                                SelectionMode="Single" Width="100%" DisplayFormatString="{0}" OnInit="lucMechanisms_Init">
                                                                <GridViewProperties>
                                                                    <Settings ShowFilterRow="true" ShowFilterRowMenu="true" />
                                                                </GridViewProperties>
                                                                <Columns>
                                                                    <dx:GridViewCommandColumn ShowSelectCheckbox="true" Caption="Выбрать" Width="50">
                                                                        <ClearFilterButton Visible="true" />
                                                                    </dx:GridViewCommandColumn>
                                                                    <dx:GridViewDataTextColumn FieldName="Name" Caption="Наименование механизма" />
                                                                    <dx:GridViewDataTextColumn FieldName="Code" Caption="Шифр" />
                                                                    <dx:GridViewDataSpinEditColumn FieldName="CostBase" Caption="Базовая стоимость">
                                                                        <PropertiesSpinEdit DecimalPlaces="2" DisplayFormatString="{0:c}" />
                                                                    </dx:GridViewDataSpinEditColumn>
                                                                    <dx:GridViewDataComboBoxColumn FieldName="Unit.Name" Caption="Единица измерения">
                                                                        <PropertiesComboBox DataSourceID="dsUnits" ValueField="UnitId" ValueType="System.Int32"
                                                                            TextField="Name" />
                                                                    </dx:GridViewDataComboBoxColumn>
                                                                </Columns>
                                                            </dx:ASPxGridLookup>
                                                        </EditItemTemplate>
                                                    </dx:GridViewDataComboBoxColumn>
                                                </Columns>
                                            </dx:ASPxGridView>
                                        </dx:ContentControl>
                                    </ContentCollection>
                                </dx:TabPage>
                                <dx:TabPage Text="Зарплата машинистов" Name="tpDrivers">
                                    <ContentCollection>
                                        <dx:ContentControl>
                                             <dx:ASPxHyperLink ID="hlDrivers" runat="server" NavigateUrl="Drivers.aspx" Text="Машинисты" />
                                            <dx:ASPxGridView ID="gvDrivers" runat="server" DataSourceID="dsWorkDrivers"
                                                KeyFieldName="WorkDriverId" OnInit="gvWorkDrivers_Init" OnRowInserting="gvWorkDrivers_RowInserting"
                                                OnRowUpdating="gvWorkDrivers_RowUpdating">
                                                <Settings ShowFooter="true" />
                                                <TotalSummary>
                                                    <dx:ASPxSummaryItem FieldName="UnitId" SummaryType="Count" />
                                                    <dx:ASPxSummaryItem FieldName="Cost" SummaryType="Sum" />
                                                </TotalSummary>
                                                <Columns>
                                                    <dx:GridViewDataDateColumn FieldName="DateCreate" Visible="false" />
                                                    <dx:GridViewCommandColumn>
                                                        <NewButton Visible="true" />
                                                        <EditButton Visible="true" />
                                                        <DeleteButton Visible="true" />
                                                    </dx:GridViewCommandColumn>
                                                    <dx:GridViewDataTextColumn FieldName="Name" Caption="Наименование машиниста">
                                                        <EditFormSettings Visible="False" />
                                                    </dx:GridViewDataTextColumn>
                                                    <dx:GridViewDataSpinEditColumn FieldName="Value" Caption="Объем, ед. изм.">
                                                        <PropertiesSpinEdit MinValue="0" NumberType="Float" />
                                                    </dx:GridViewDataSpinEditColumn>
                                                    <dx:GridViewDataComboBoxColumn FieldName="UnitId" Caption="Единица измерения">
                                                        <EditFormSettings Visible="False" />
                                                        <PropertiesComboBox DataSourceID="dsUnits" ValueField="UnitId" ValueType="System.Int32"
                                                            TextField="Name" />
                                                    </dx:GridViewDataComboBoxColumn>
                                                    <dx:GridViewDataSpinEditColumn FieldName="CostBase" Caption="Стоимость ед. изм.">
                                                        <PropertiesSpinEdit DecimalPlaces="2" DisplayFormatString="{0:c}" />
                                                        <EditFormSettings Visible="False" />
                                                    </dx:GridViewDataSpinEditColumn>
                                                    <dx:GridViewDataSpinEditColumn FieldName="Cost" Caption="Общая стоимость">
                                                        <PropertiesSpinEdit DecimalPlaces="2" DisplayFormatString="{0:c}" />
                                                        <EditFormSettings Visible="False" />
                                                    </dx:GridViewDataSpinEditColumn>
                                                    <dx:GridViewDataComboBoxColumn FieldName="DriverId" Caption="Машинист" Visible="false">
                                                        <EditFormSettings Visible="True" />
                                                        <EditItemTemplate>
                                                            <dx:ASPxGridLookup ID="lucDrivers" runat="server" DataSourceID="dsDrivers" KeyFieldName="DriverId"
                                                                SelectionMode="Single" Width="100%" DisplayFormatString="{0}" OnInit="lucDrivers_Init">
                                                                <GridViewProperties>
                                                                    <Settings ShowFilterRow="true" ShowFilterRowMenu="true" />
                                                                </GridViewProperties>
                                                                <Columns>
                                                                    <dx:GridViewCommandColumn ShowSelectCheckbox="true" Caption="Выбрать" Width="50">
                                                                        <ClearFilterButton Visible="true" />
                                                                    </dx:GridViewCommandColumn>
                                                                    <dx:GridViewDataTextColumn FieldName="Name" Caption="Наименование машиниста" />
                                                                    <dx:GridViewDataTextColumn FieldName="Code" Caption="Шифр" />
                                                                    <dx:GridViewDataSpinEditColumn FieldName="CostBase" Caption="Базовая стоимость">
                                                                        <PropertiesSpinEdit DecimalPlaces="2" DisplayFormatString="{0:c}" />
                                                                    </dx:GridViewDataSpinEditColumn>
                                                                    <dx:GridViewDataComboBoxColumn FieldName="Unit.Name" Caption="Единица измерения">
                                                                        <PropertiesComboBox DataSourceID="dsUnits" ValueField="UnitId" ValueType="System.Int32"
                                                                            TextField="Name" />
                                                                    </dx:GridViewDataComboBoxColumn>
                                                                </Columns>
                                                            </dx:ASPxGridLookup>
                                                        </EditItemTemplate>
                                                    </dx:GridViewDataComboBoxColumn>
                                                </Columns>
                                            </dx:ASPxGridView>
                                        </dx:ContentControl>
                                    </ContentCollection>
                                </dx:TabPage>
                                <dx:TabPage Text="Основная зарплата" Name="tpWorkers">
                                    <ContentCollection>
                                        <dx:ContentControl>
                                            <dx:ASPxHyperLink ID="hlWorkers" runat="server" NavigateUrl="Workers.aspx" Text="Рабочие" />
                                            <dx:ASPxGridView ID="gvWorkers" runat="server" DataSourceID="dsWorkWorkers"
                                                KeyFieldName="WorkWorkerId" OnInit="gvWorkWorkers_Init" OnRowInserting="gvWorkWorkers_RowInserting"
                                                OnRowUpdating="gvWorkWorkers_RowUpdating">
                                                <Settings ShowFooter="true" />
                                                <TotalSummary>
                                                    <dx:ASPxSummaryItem FieldName="UnitId" SummaryType="Count" />
                                                    <dx:ASPxSummaryItem FieldName="Cost" SummaryType="Sum" />
                                                </TotalSummary>
                                                <Columns>
                                                    <dx:GridViewDataDateColumn FieldName="DateCreate" Visible="false" />
                                                    <dx:GridViewCommandColumn>
                                                        <NewButton Visible="true" />
                                                        <EditButton Visible="true" />
                                                        <DeleteButton Visible="true" />
                                                    </dx:GridViewCommandColumn>
                                                    <dx:GridViewDataTextColumn FieldName="Name" Caption="Наименование рабочего">
                                                        <EditFormSettings Visible="False" />
                                                    </dx:GridViewDataTextColumn>
                                                    <dx:GridViewDataSpinEditColumn FieldName="Value" Caption="Объем, ед. изм.">
                                                        <PropertiesSpinEdit MinValue="0" NumberType="Float" />
                                                    </dx:GridViewDataSpinEditColumn>
                                                    <dx:GridViewDataComboBoxColumn FieldName="UnitId" Caption="Единица измерения">
                                                        <EditFormSettings Visible="False" />
                                                        <PropertiesComboBox DataSourceID="dsUnits" ValueField="UnitId" ValueType="System.Int32"
                                                            TextField="Name" />
                                                    </dx:GridViewDataComboBoxColumn>
                                                    <dx:GridViewDataSpinEditColumn FieldName="CostBase" Caption="Стоимость ед. изм.">
                                                        <PropertiesSpinEdit DecimalPlaces="2" DisplayFormatString="{0:c}" />
                                                        <EditFormSettings Visible="False" />
                                                    </dx:GridViewDataSpinEditColumn>
                                                    <dx:GridViewDataSpinEditColumn FieldName="Cost" Caption="Общая стоимость">
                                                        <PropertiesSpinEdit DecimalPlaces="2" DisplayFormatString="{0:c}" />
                                                        <EditFormSettings Visible="False" />
                                                    </dx:GridViewDataSpinEditColumn>
                                                    <dx:GridViewDataComboBoxColumn FieldName="WorkerId" Caption="Рабочий" Visible="false">
                                                        <EditFormSettings Visible="True" />
                                                        <EditItemTemplate>
                                                            <dx:ASPxGridLookup ID="lucWorkers" runat="server" DataSourceID="dsWorkers" KeyFieldName="WorkerId"
                                                                SelectionMode="Single" Width="100%" DisplayFormatString="{0}" OnInit="lucWorkers_Init">
                                                                <GridViewProperties>
                                                                    <Settings ShowFilterRow="true" ShowFilterRowMenu="true" />
                                                                </GridViewProperties>
                                                                <Columns>
                                                                    <dx:GridViewCommandColumn ShowSelectCheckbox="true" Caption="Выбрать" Width="50">
                                                                        <ClearFilterButton Visible="true" />
                                                                    </dx:GridViewCommandColumn>
                                                                    <dx:GridViewDataTextColumn FieldName="Name" Caption="Наименование рабочего" />
                                                                    <dx:GridViewDataTextColumn FieldName="Code" Caption="Шифр" />
                                                                    <dx:GridViewDataSpinEditColumn FieldName="CostBase" Caption="Базовая стоимость">
                                                                        <PropertiesSpinEdit DecimalPlaces="2" DisplayFormatString="{0:c}" />
                                                                    </dx:GridViewDataSpinEditColumn>
                                                                    <dx:GridViewDataComboBoxColumn FieldName="Unit.Name" Caption="Единица измерения">
                                                                        <PropertiesComboBox DataSourceID="dsUnits" ValueField="UnitId" ValueType="System.Int32"
                                                                            TextField="Name" />
                                                                    </dx:GridViewDataComboBoxColumn>
                                                                </Columns>
                                                            </dx:ASPxGridLookup>
                                                        </EditItemTemplate>
                                                    </dx:GridViewDataComboBoxColumn>
                                                </Columns>
                                            </dx:ASPxGridView>
                                        </dx:ContentControl>
                                    </ContentCollection>
                                </dx:TabPage>
                            </TabPages>
                        </dx:ASPxPageControl>
                        <div style="text-align: right; padding: 2px 2px 2px 2px">
                            <dx:ASPxGridViewTemplateReplacement ID="UpdateButton" ReplacementType="EditFormUpdateButton"
                                runat="server"></dx:ASPxGridViewTemplateReplacement>
                            <dx:ASPxGridViewTemplateReplacement ID="CancelButton" ReplacementType="EditFormCancelButton"
                                runat="server"></dx:ASPxGridViewTemplateReplacement>
                        </div>
                    </EditForm>
                </Templates>
            </dx:ASPxGridView>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
